import * as actionTypes from './constants'

import { Map } from 'immutable';

// 转换为immutable对象
const defaultState = Map({
  featureRanking:[],
  mediaRanking:[]
})

function reducer(state = defaultState, action) {
  switch(action.type){
    case actionTypes.LIST_DATA_FEATURE:
      return state.set("featureRanking", action.featureRanking);
    case actionTypes.LIST_DATA_MEDIA:
      return state.set("mediaRanking", action.mediaRanking);
    default:
      return state;
  }
}

export default reducer;